1. Field of the Invention
The present invention relates to an image voice play apparatus, more particularly, to an image voice play apparatus that plays an AVI (Audio Visual Interleaving) file.
2. Description of the Related Art
Conventionally, various image voice play apparatuses that play an AVI file are developed. Here, FIG. 1 shows a structure of an AVI file.
An AVI file includes at least one AVI chunk. Here, FIG. 1 shows an exemplary AVI file that includes three AVI chunks. And, each AVI chunk is composed of: a head chunk; an idx1 chunk; and a movi chunk. In the movi chunk, basically an image chunk (00 dc chunk) and a voice chunk (01 wb chunk) are alternately arranged; however, in some cases, a chunk other than the image chunk and the voice chunk is included. As the chunk other than the image chunk and the voce chunk, there are a sub-title chunk (02 sb chunk), a junk chunk and the like.
As shown in FIG. 1, one image chunk is image data for one frame, and one voice chunk is voice data for one frame.
Besides, as shown in FIG. 1, each head chunk stores a playing time for one image chunk, a playing time for one voice chunk, and the number of image chunks that are contained in a movi chunk in an AVI chunk to which the head chunk itself belongs.
When it is supposed that a playing time of an m-th image frame is t, and a playing time of an n-th voice frame is t, the following formula is met. In the AVI file, a physical synchronization between the image chunk and the voice chunk is not secured, m and n usually have different values.m=t/(the playing time for one image chunk)n=t/(the playing time for one voice chunk)
As is clear from the above formula, obtaining an image chunk and a voice chunk corresponding to a playing time is determining which-address image chunk the image chunk corresponding to the playing time is and determining which-address voice chunk the voice chunk corresponding to the playing time is.
Each idx1 chunk has a form shown in FIG. 2 and stores playing times and position information of an image chunk and a voice chunk that are contained in a movi chunk in the AVI chunk to which the idx1 chunk itself belongs. In each idx1 chunk, information of all kinds of chunks, which is contained in the movi chunk in the AVI chunk to which the idx1 chunk belongs, is written in 16 bytes for one chunk. Further, each idx1 chunk writes the size (data amount) of itself in the head of itself.
In a conventional image voice play apparatus, when executing a time search for an AVI file, to obtain a play position, it is necessary to count the number of voice chunks and the number of image chunks from the head of the first idx1 chunk.
For example, in the conventional image voice play apparatus, if a 50-minute time search is specified targeting a 60-minute AVI file that has a playing time of 1/30 sec. for one voice chunk and includes three AVI chunks which are 20 minutes long each, first, the number of voice chunks is counted from the head of the first idx1 chunk. Even if the reading is performed to the last of the first idx1 chunk, 90000 (=50×60×30) which is the desired number of voice chunks is not reached; accordingly, subsequently, the number of voice chunks is counted from the head of the second idx1 chunk. Even if the reading is performed to the last of the second idx1 chunk, 90000 (=50×60×30) which is the desired number of voice chunks is not reached; accordingly, subsequently, the number of voice chunks is counted from the head of the third idx1 chunk. During the reading of the third idx1 chunk, the 90000th voice chunk is located and the counting of the number of voice chunks ends.
As described above, in the conventional image voice play apparatus, when executing a time search for an AVI file, to obtain a play position, it is necessary to count the number of voice chunks from the head of the first idx1 chunk, so that there is a problem that the time search process tales a long time.
Here, JP-A-2006-526245 discloses a method that determines to which chunk the number of chunks corresponding to a start position of a file that a terminal requests a server belongs; however, this is a determination method which supposes that the size of a chunk except a header portion is known, so that the method is inapplicable to a time search for an AVI file.
Besides, JP-A-2003-289504 discloses that if an index is not valid, an estimated position is calculated from a specified playing time and an average bit rate of an MPEG-2 stream instead of the index; however, even if this technology is used for a time search process for an AVI file, it is impossible to quickly locate a voice chunk that corresponds to the desired number of voice frames.
Besides, JP-A-2006-217126 discloses that in playing an AVI stream, control which repeats a search changing the search area and the stream input position is performed to locate a 4-byte code that is closest to the play start position, and the play is performed from the correct play start position; however, even if this technology is used for a time search process for an AVI file, it is impossible to quickly locate a voice chunk that corresponds to the desired number of voice frames.